package com.songshuai.webapi.jobapi.common.exception;


import com.songshuai.webapi.jobapi.common.enumerations.ResultStatus;

public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    public BusinessException() {}

    public BusinessException(ResultStatus resultEnum) {
        super(resultEnum.getErrorMsg());
        this.code = resultEnum.getErrorCode();
    }

    public BusinessException(String errMsg,ResultStatus resultEnum) {
        super(errMsg);
        this.code = resultEnum.getErrorCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
